#ifndef _KERNPARAM_H_
#define _KERNPARAM_H_

#include "debug.h"

/* page size 4k */
#define PG_SIZE		0x1000


/* page directory's base physical address */
#define PHY_START	0x100000
#define PD_BASE		PHY_START

/* first page frame is used for page table, next */
/* 0x39 page frames are used for process */
/* every process will take 0x40 * 4K = 256K memory ,include kernel*/
/* so the interval between two process is 256K, too */
#define PG_NUM		0x40
#define SV_INTERVAL	( PG_NUM * PG_SIZE)


/* user stack in the last but one page */
#define PROC_USER_STACK ((PG_NUM - 2) * PG_SIZE)
/* kernel stack in the last page */
#define PROC_KERN_STACK	((PG_NUM - 1) * PG_SIZE)


#if (KDEBUG == 1)
/* kernel's base linear address */
#define K_VM				0x00000000

/* the linear address filed between 2M and 2M + 4K 
   is used for map the whole physical address */ 
#define KMAP_VM				0x00200000		

/* kernel stack located between 0x300000 and 0x3FFFF0,
 * and we initialize it by the high value 
 */
#define K_STACK				0x003FFFF0

/* user space linear address from 0x00400000 */
#define U_VM				0x00400000

/* user stack located from 0x00700000 to 0x00800000,
 * and we intialize it by the high value 
 */
#define U_STACK				0x007FFFF0
#else

/* kernel's base linear address */
#define K_VM				0xC0000000
#define U_VM				0x00000000
#define KMAP_VM				0x00000000
#define KMAP_MSG_SRC_VM		0x00000000
#define KMAP_MSG_DST_VM		0x00000000
#define KMAP_PD_VM			0x00000000
#define KMAP_PT_VM			0x00000000

#define K_STACK_BASE		K_VM
/* kernel's base physical address */
/* -------------------------------------------------------------------------------  */
/*      | page directory | kernel page |  kernel    | server   |  user processes    */
/* -------------------------------------------------------------------------------  */
/*0M   1M              1M + 4K      1M + 8K       .....                             */

#define K_BASE		( PD_BASE + PG_SIZE + PG_SIZE)  /* 1M + 8K */

#endif		/* end of (KDEBUG == 1) */

#endif
